/* GUI CONVERTED from eciq12.p (converter v1.75) Mon Aug 14 12:26:54 2000 */
/* eciq12.p - ECN ITEM INQUIRY                                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*F0PN*/ /*V8:ConvertMode=Report                                        */
/*K1Q4*/ /*V8:RunMode=Character,Windows                                 */
/* REVISION: 7.4      LAST MODIFIED: 04/21/94   BY: qzl *H358*          */
/* REVISION: 7.4      LAST MODIFIED: 12/01/94   BY: qzl *H612*          */
/* REVISION: 7.4      LAST MODIFIED: 04/06/95   BY: ame *H0CF*          */
/*                                   04/24/95   by: srk *H0C4*          */
/* REVISION: 7.4      LAST MODIFIED: 10/08/96   BY: *H0N2*  Russ Witt       */


/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan       */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan       */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00 BY: *N0KW* Jacolyn Neder      */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*H0CF*/ {mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE eciq12_p_1 "Comments"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/*H0C4*  {ecmtparm.i} */
/*H0C4*/ /*PLACED CONTENTS OF ECMTPARM.I IN HERE*/
         define input parameter ecm_recid as recid.
         define input parameter prog_type as character.
         define input parameter inq_yn as logical.
         define input parameter dmpld like mfc_logical.
         define input parameter mstrfile like mfc_logical.
         define output parameter msgnbr like msg_nbr initial 0.
         define output parameter warnlvl as integer initial 0.

         define variable ecdcmmts like mfc_logical initial no label {&eciq12_p_1}.
         define variable true1 like mfc_logical initial yes.
         define variable false1 like mfc_logical initial no.

         define shared workfile ecmmstr like ecm_mstr.
         define shared workfile ecddet  like ecd_det.
         define shared workfile cmtdet  like cmt_det.
         define shared variable error_msg as character format "x(60)" extent 10.

     do for ecmmstr,ecddet,cmtdet:

         /* DISPLAY SELECTION FORM */
         FORM /*GUI*/ 
            {ecform04.i}
         with STREAM-IO /*GUI*/  frame form04 side-labels width 80 attr-space.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame form04:handle).

         FORM /*GUI*/ 
            {ecform05.i}
         with STREAM-IO /*GUI*/  frame form05 side-labels width 80 attr-space.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame form05:handle).

         find first ecmmstr where recid(ecmmstr) = ecm_recid no-lock no-error.
         if not available (ecmmstr) then return.

         find first ecddet where ecd_nbr = ecm_nbr no-lock no-error.
         if available ecddet then page.

         for each ecddet where ecd_nbr = ecm_nbr no-lock with frame form04:
             find pt_mstr no-lock where pt_part = ecd_part
/*H612*/     no-error.
             display
/*H612*         {ecform04.i}    */
/*H612*/        ecd_part
/*H612*/        pt_desc1 when (available pt_mstr)
/*H612*/        pt_um when (available pt_mstr)
/*H612*/        pt_desc2 when (available pt_mstr)
             with frame form04 side-labels width 80 attr-space STREAM-IO /*GUI*/ .

             display
                ecd__qad01
                true1 when (ecd_cmtindx <> 0) @ ecdcmmts
                false1 when (ecd_cmtindx = 0) @ ecdcmmts
                ecd_prodline
                ecd_part_type
                ecd_draw
                pt_add
/*H612*/        when (available pt_mstr)
                ecd_status
                ecd_drwg_loc
                ecd_drwg_size
                ecd_dsgn_grp
                ecd_group
                ecd_inv_dspn
                pt_rev
/*H612*/        when (available pt_mstr)
                ecd_old_rev
                ecd_new_rev
                max(pt_rev, pt_ecn_rev)
/*H612*/        when (available pt_mstr)
                @ ecd_old_rev
             with frame form05 STREAM-IO /*GUI*/ .

             if not dmpld then do:
                if not mstrfile then put error_msg[6].
                else if not dmpld and can-find(ecd_det where ecd_det.ecd_nbr =
                ecddet.ecd_nbr and ecd_det.ecd_part = ecddet.ecd_part and
                ecd_det.ecd_new = ecddet.ecd_new) then put error_msg[1].
/*H612*/        else if not can-find(pt_mstr where pt_part = ecddet.ecd_part)
/*H612*/        then put error_msg[3].
             end.
             down.

             if ecd_cmtindx <> 0 then do:
                for each cmtdet no-lock where cmt_indx = ecd_cmtindx
                with frame ecdb attr-space side-labels width 80 overlay:
                   FORM /*GUI*/  cmt_seq skip
                        cmt_cmmt[1] no-label
                        cmt_cmmt[2] no-label
                        cmt_cmmt[3] no-label
                        cmt_cmmt[4] no-label
                        cmt_cmmt[5] no-label
                        cmt_cmmt[6] no-label
                        cmt_cmmt[7] no-label
                        cmt_cmmt[8] no-label
                   with STREAM-IO /*GUI*/  frame ecdb.
                   display cmt_seq + 1 @ cmt_seq
                   cmt_cmmt[1 for 8] no-label with frame ecdb STREAM-IO /*GUI*/ .
                   down.

                   if cmt_cmmt[9] + cmt_cmmt[10] + cmt_cmmt[11] + cmt_cmmt[12]
                    + cmt_cmmt[13] + cmt_cmmt[14] + cmt_cmmt[15] <> ""
                   then do with frame ecdb:
                      display cmt_seq + 1 @ cmt_seq
                      cmt_cmmt[9]  @ cmt_cmmt[1]
                      cmt_cmmt[10] @ cmt_cmmt[2]
                      cmt_cmmt[11] @ cmt_cmmt[3]
                      cmt_cmmt[12] @ cmt_cmmt[4]
                      cmt_cmmt[13] @ cmt_cmmt[5]
                      cmt_cmmt[14] @ cmt_cmmt[6]
                      cmt_cmmt[15] @ cmt_cmmt[7]
                      with frame ecdb STREAM-IO /*GUI*/ .
                      down.
                   end.
                   if not dmpld then do:
                      if not mstrfile then put error_msg[6].
/*H0N2*               START OF CODE DELETED...
.                     else if can-find (cmt_det where
.                     cmt_det.cmt_indx = cmtdet.cmt_indx and
.                     cmt_det.cmt_seq = cmtdet.cmt_seq) then do:
./*H612*                 put error_msg[1].  */
./*H612*/                put error_msg[7].
.                        put "Index keys = " + string(cmtdet.cmt_indx) + "," +
.                        string(cmtdet.cmt_seq) format "x(50)".
.                     end.
.*H0N2*               END OF CODE DELETED    */
                   end.
                   down.
                   
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

                end.
                hide frame ecdb.
             end.
             
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

          end.
       end.
